<%--
 *  File:   EmployeeInfomation.jsp
 *  Desc:	Report Director depend on eSpreadsheet
 *
 *  Date		        Author		  Changes
 *  2013-01-11	  		Saraxia	 	  Created
 *   
 *
 *  Copyright (C) 2000 - 2008 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<%
			String privilegeCode = "10221,10222";
			String strTableName = "";
			String strModuleName = "COM";
			String contextPath = request.getContextPath();

%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>

<iframe name="reloadHandler" style="display:none"></iframe>
<html>
<head>
<title>EmployeeInfomation</title>
<PageFlow:CheckPageFlow pageName="p_employeeinfo" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/Calendar.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>


<%@ include file="/inc/SummaryDivision.inc" %>
<%
Vector totalsummary = (Vector) pageContext.getAttribute("totalsummary");
			if (totalsummary == null)
				totalsummary = new Vector();

			HashMap UserInfo = (HashMap) session.getAttribute("userinfo");
			if (UserInfo == null)
				UserInfo = new HashMap();
    Integer loginemployeeid = (Integer)UserInfo.get("employeeid");
java.util.Calendar cal = java.util.Calendar.getInstance();	
String flag = (String)pageContext.getAttribute("flag");
%>
			

<%--  put your custom script here   --%>

<script language="JavaScript">

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  	editform.action = "EmployeeInfomation.jsp?<%= OvalTools.randomURL() %>";
    editform.target = "_self";
    isRunning = true;
    editform.submit();
}


function page_popBusinessarea()
{
  if (typeof popwindow != 'undefined') popwindow.close();
  popwindow = window.open("<%=contextPath%>/masterdata/ogm/zylstdbusinessareapop.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>","newwindow", "height=300, width=800,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
	
}

function setContact(id,type,name){
	document.cform.stdareatype.value=id;
	document.cform.strareaname.value=name;
}


function page_export1() {
	var begindate = document.cform.startyears.value+"-"+document.cform.startmonths.value;
	//var enddate = document.cform.endyears.value+"-"+document.cform.endmonths.value;
	var deptid = document.cform.deptids.value;
	var stdareatype = document.cform.stdareatype.value;
	var strareaname=document.cform.strareaname.value;
	var status = document.cform.status.value;
	if(deptid=='-1')
	{
	    //var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo1.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&strareaname="+escape(encodeURI(strareaname))+"&status="+status;
	    var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo1.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&strareaname="+stdareatype+"&status="+status;
	    var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
	    popwindow = window.open(url, "n1window", strstatus);
	}
	else{
	    //var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo1.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&deptid="+deptid+"&strareaname="+escape(encodeURI(strareaname))+"&status="+status;
	    var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo1.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&deptid="+deptid+"&strareaname="+stdareatype+"&status="+status;
	    var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
	    popwindow = window.open(url, "n1window", strstatus);
	}
                 
}

function page_export2() {
	var begindate = document.cform.startyears.value+"-"+document.cform.startmonths.value;
	//var enddate = document.cform.endyears.value+"-"+document.cform.endmonths.value;
	var deptid = document.cform.deptids.value;
	var stdareatype = document.cform.stdareatype.value;
	var strareaname=document.cform.strareaname.value;
	var status = document.cform.status.value;
	if(deptid=='-1')
	{
	    //var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo2.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&strareaname="+escape(encodeURI(strareaname))+"&status="+status;
	    var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo2.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&strareaname="+stdareatype+"&status="+status;
	    var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
	    popwindow = window.open(url, "n1window", strstatus);
	}
	else{
	    //var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo2.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&deptid="+deptid+"&strareaname="+escape(encodeURI(strareaname))+"&status="+status;
	    var url = "<%=reportURL%>/servlet/ExcecuteReport/employeeinfo2.sox?__format=xlsx&__folder=/ovalreport&startdate="+begindate+"&deptid="+deptid+"&strareaname="+stdareatype+"&status="+status;
	    var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
	    popwindow = window.open(url, "n1window", strstatus);
	}
                 
}

</script>

</head>
<body style="overflow: auto;" >
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
	<input type="hidden" name="pagename" value="p_employeeinfo">
	<input type="hidden" name="actionname">
	<input type="hidden" name="prodcode">
    <input type="hidden" name="flag" value="<%=flag %>">
	<custom:hidden property="languagecode" scope="session" name="userinfo"/>
	<custom:hidden property="contactid" scope="session" name="userinfo" changedName="loginid"/>
	<%--  page location   --%>
<%@ include file="/inc/PageLocation.inc"%>


<table width="100%" border="0" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
<!-------------------------------------1 row -------------------------------------------------->
	<tr>
		<td class="title_center">
			<div align="right">
				<%= label.getLabelName("L_Dept") %><%= label.getLabelName("L_Colon") %>
			</div>
		</td>
		 <td>
			       <custom:select property="deptids" optionsName="alldeptnames"
							optionValueKey="deptid" optionInnerTextKey="deptname" defaultValue="--------"/>
		</td>
		
       <td class="title_center">
			<div align="right">
				<%= label.getLabelName("L_Provicetdr") + label.getLabelName("L_Colon") %>
			</div>  
		</td>
        <td width="228" >
					<custom:hidden property="stdareatype"  />
		           	<custom:text property="strareaname" />
		           	<a onclick="page_popBusinessarea();"><custom:button type="3" value="*"/></a>
        </td>

	   <td class="title_center">
			<div align="right">
				<%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %>
			</div>
		</td>
	   <td width="228">
					<custom:selectdic dictType="Status" property="status" valueCriteria="28,41" defaultValue="------" defaultValueCost=""/>
       </td>

       


	</tr>
<!-------------------------------------2 row -------------------------------------------------->
				<%
                    String year = cal.get(Calendar.YEAR)+"";     
					String month = cal.get(Calendar.MONTH)+"";
					if(cal.get(Calendar.MONTH) == 0){
						month = "12";
						year = (cal.get(Calendar.YEAR)-1)+"";
					}  
					
				%>
	<tr>
		<td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_StartYear")+label.getLabelName("L_Colon")%>
			</div>
		</td>
		<td class="title_center">
			<div align="left">
				<custom:selectdic property="startyears" dictType="Years" command="notnull" value="<%=year %>" label="L_Year1" />
			</div>
		</td>

		<td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_BeginMonth")+label.getLabelName("L_Colon")%>
			</div>
		</td>
	<td class="title_center">
			<div align="left">
				<custom:selectdic property="startmonths" dictType="Months" command="notnull" value="<%=month %>" label="L_Month" />
			</div>
		</td>
	</tr>
<!-------------------------------------3 row -------------------------------------------------->
<!-- 
	<tr>
		<td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_EndYear")+label.getLabelName("L_Colon")%>
			</div>
		</td>
		<td class="title_center">
			<div align="left">
				<custom:selectdic property="endyears" dictType="Years" command="notnull" value="<%=year %>" label="L_Year1" />
			</div>
		</td>

		<td class="title_center">
			<div align="right">
				<%=label.getLabelName("L_CloseMonth")+label.getLabelName("L_Colon")%>
			</div>
		</td>
		<td class="title_center">
			<div align="left">
				<custom:selectdic property="endmonths" dictType="Months" command="notnull" value="<%=month %>" label="L_Month" />
			</div>
		</td>
	</tr>
 -->


 </table>

		 <table width="100%" cellspacing="0" cellpadding="0">
		        <tr>
		          <td class="summary_top"></td>
		        </tr>
		        <tr>
		          <td class="summary_top"></td>
		        </tr>
		        <tr>
		          <td class="summary_top"></td>
		        </tr>
		        <tr>
		          	<td class="td_center">
				  		<a onclick="page_export1();"><input name="button" type="button"  value="<%=label.getLabelName("L_BusinessPeople")%>" /></a>
				  		&nbsp;&nbsp;&nbsp;&nbsp;
				  		<a onclick="page_export2();"><input name="button" type="button" value="<%=label.getLabelName("L_CenterPeople")%>" /></a>
					</td>
		        </tr>
     	</table>
</form>
</body>
</html>
